Skip to content

[Nexthop][fboss2-dev] Warn instead of rejecting a profile the transceiver does not support - #1982

Open
hillol-nexthop wants to merge 1 commit into
meta:mainfrom
nexthop-ai:profile-qsfp-warning
Open

hillol-nexthop wants to merge 1 commit into
meta:mainfrom
nexthop-ai:profile-qsfp-warning

Conversation

@hillol-nexthop

@hillol-nexthop hillol-nexthop commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

fboss2-dev config interface <port> profile <p> rejects any profile that is not in qsfp_service's transceiver-filtered list for the port (getAllPortSupportedProfiles(checkOptics=true)). The agent has no such check: it applies whatever platform-supported profile its config carries. A port can therefore be running a profile that the CLI refuses to set, including re-applying the one it already runs.

A concrete case: a passive copper cable on a port whose config profile is OPTICAL. The link is up, but since passive copper stopped reporting OPTICAL profiles as supported, the CLI rejects that profile. ConfigInterfaceProfileTest.ChangeProfileWithoutSubsumingSucceeds and DeleteInterfaceTest.DeleteWholePortRemovesCreatedSubport fail on such a device: they move the port to another profile and then cannot restore the original one.

Invalid argument: Invalid profile 'PROFILE_800G_8_PAM4_RS544X2N_OPTICAL' for port eth1/1/1 based on QSFP capabilities. Supported profiles: [PROFILE_400G_4_PAM4_RS544X2N_COPPER, PROFILE_800G_8_PAM4_RS544X2N_COPPER]

This change makes the CLI follow the same rule as the agent: the platform mapping decides what is accepted, and the transceiver list is advisory.

  • CmdConfigInterface.cpp: applyProfileImpl no longer passes the transceiver list to utility::applyPortProfileChanges, so validation is platform-only. After a successful apply it compares each requested port against its non-empty transceiver list and collects a warning for a mismatch. queryClient prints the warnings on their own lines after the success line.
  • When qsfp_service cannot be reached, the failure is logged and the output says the profile was not checked against the transceiver, so a skipped check is visible.
  • utility::applyPortProfileChanges keeps its behaviour and tests. Its optional transceiver constraint now has no caller in the CLI; I left it in place since it is part of the shared API and noted in its doc comment that fboss2-dev does not pass it, but can remove it here if you prefer.
  • show interface capabilities and qsfp_service are unchanged.
$ fboss2-dev config interface eth1/1/1 profile PROFILE_800G_8_PAM4_RS544X2N_OPTICAL
Successfully configured interface(s) eth1/1/1: profile=PROFILE_800G_8_PAM4_RS544X2N_OPTICAL, speed=800000
Warning: profile 'PROFILE_800G_8_PAM4_RS544X2N_OPTICAL' is not supported by the transceiver on port eth1/1/1. Supported profiles: [PROFILE_400G_4_PAM4_RS544X2N_COPPER, PROFILE_800G_8_PAM4_RS544X2N_COPPER]

Behaviour change to be aware of: a profile an optical module cannot run is now also accepted with a warning instead of rejected, the same as it would be if it came from the agent config. If you would rather keep the rejection for that case and relax only re-applying the running profile, I am happy to rework it that way.

Known limit, unchanged from before: qsfp_service returns no entry for a port when the transceiver matches none of its profiles or the cage is empty, so there is nothing to warn against in that case.

Tests:

  • Unit: rejectsProfileUnsupportedByQsfp becomes warnsOnlyForPortsUnsupportedByQsfp (two ports in one command, one warns); added warnsOnExistingPortUnsupportedByQsfp, noWarningWhenQsfpSupportsOrDoesNotReportPort, queryClientPrintsQsfpWarningAfterSuccess and queryClientReportsUnreachableQsfpService.
  • Integration: added ConfigInterfaceProfileTest.ProfileUnsupportedByOpticsWarns. It commits a platform-supported profile the port's transceiver does not support (one other than the running profile that subsumes nothing when available, otherwise the running profile), checks the warning, waits for the agent to report the profile, and restores the original.

Test Plan

Unit tests (this branch, OSS cmake build):

ctest
ApplyProfileSubsumeTestFixture.warnsOnExistingPortUnsupportedByQsfp ................ Passed
CreatePendingInterfacePortsTestFixture.warnsOnlyForPortsUnsupportedByQsfp ......... Passed
CreatePendingInterfacePortsTestFixture.noWarningWhenQsfpSupportsOrDoesNotReportPort  Passed
CreatePendingInterfacePortsTestFixture.queryClientPrintsQsfpWarningAfterSuccess ... Passed
CreatePendingInterfacePortsTestFixture.queryClientReportsUnreachableQsfpService ... Passed
100% tests passed, 0 tests failed out of 3414

Integration tests on an NH-4010-F whose ports eth1/1/1, eth1/2/1 and eth1/4/1 hold passive copper cables, are configured with PROFILE_800G_8_PAM4_RS544X2N_OPTICAL, and are link Up at 800G.

Before:

run_test.py fboss2_integration --filter='ConfigInterfaceProfileTest.*:DeleteInterfaceTest.DeleteWholePortRemovesCreatedSubport'
[  FAILED  ] ConfigInterfaceProfileTest.ChangeProfileWithoutSubsumingSucceeds   (restore.exitCode 1)
[  FAILED  ] DeleteInterfaceTest.DeleteWholePortRemovesCreatedSubport          (restore.exitCode 1)
   PASSED : 6
   FAILED : 2
   SKIPPED : 1

After:

[       OK ] ConfigInterfaceProfileTest.ChangeProfileWithoutSubsumingSucceeds
[       OK ] ConfigInterfaceProfileTest.ChangeToUnsupportedProfileRejected
[       OK ] ConfigInterfaceProfileTest.CreateFreedPortSucceeds
[       OK ] ConfigInterfaceProfileTest.CreateFreedPortWithMtuInOneCommand
[       OK ] ConfigInterfaceProfileTest.CreateStillSubsumedPortRejected
[       OK ] ConfigInterfaceProfileTest.ProfileUnsupportedByOpticsWarns
[       OK ] ConfigInterfaceProfileTest.SetInvalidProfileFails
[       OK ] ConfigInterfaceProfileTest.SetProfileMultiInterface
[       OK ] DeleteInterfaceTest.DeleteWholePortRemovesCreatedSubport
[  SKIPPED ] ConfigInterfaceProfileTest.ChangeProfileSubsumesAndRemovesPorts
   PASSED : 9
   FAILED : 0
   SKIPPED : 1

On the device the new test committed a real change and put it back:

port=eth1/2/1 PROFILE_800G_8_PAM4_RS544X2N_OPTICAL -> PROFILE_100G_1_PAM4_RS544_OPTICAL
config interface eth1/2/1 profile PROFILE_100G_1_PAM4_RS544_OPTICAL     (warning, committed, agent reports it)
config interface eth1/2/1 profile PROFILE_800G_8_PAM4_RS544X2N_OPTICAL  (restore)

With qsfp_service stopped:

$ fboss2-dev config interface eth1/1/1 profile PROFILE_800G_8_PAM4_RS544X2N_OPTICAL
Successfully configured interface(s) eth1/1/1: profile=PROFILE_800G_8_PAM4_RS544X2N_OPTICAL, speed=800000
Warning: qsfp_service is unreachable, so the profile was not checked against the transceiver

A platform-unsupported profile is still rejected:

$ fboss2-dev config interface eth1/1/1 profile PROFILE_10G_1_NRZ_NOFEC
Invalid argument: Invalid profile 'PROFILE_10G_1_NRZ_NOFEC' for port eth1/1/1. Supported profiles: [...]

The device run used binaries built from our internal tree, where the integration test reads the transceiver list through a shared fixture helper that is not upstream yet; in this PR the test queries qsfp_service directly. That variant was compiled and linked by the OSS cmake build but not run on a device. Not run: a device with optical modules, where the committed profile is one the optic rejects.

Review Findings

Pre-publication review found no correctness or build issues. Two low-severity notes remain; findings acknowledged, pushed at author's discretion.

File Category Severity Issue Confidence
fboss/lib/config/agent/PortConfigUtils.cpp Stale path low The optional transceiver constraint in applyPortProfileChanges is no longer passed by the CLI, so its reject branch is reachable only from the library's own tests. Left in place as part of the shared API. 0.9
fboss/cli/fboss2/commands/config/interface/CmdConfigInterface.cpp Behaviour gap low No warning when qsfp_service returns no entry for a port (transceiver matches none of its profiles, or the cage is empty). Same blind spot as before this change. 0.8

@hillol-nexthop
hillol-nexthop requested a review from a team as a code owner November 16, 2026 06:25
@meta-cla meta-cla Bot added the CLA Signed label Nov 16, 2026
@github-actions github-actions Bot added nexthop project:fboss2-dev FBOSS project: fboss2-dev labels Nov 16, 2026
@hillol-nexthop
hillol-nexthop requested a review from a team as a code owner November 16, 2026 08:50
… not support

`fboss2-dev config interface <port> profile <p>` rejected any profile
missing from qsfp_service's transceiver-filtered list for the port. The
agent has no such check: it applies whatever platform-supported profile
its config carries. A port could therefore be running a profile that the
CLI refused to set, including re-applying the one it already runs. One
case is a passive copper cable on a port configured with an OPTICAL
profile: the link is up, but once the port is moved to a COPPER profile
the CLI cannot move it back.

Make the transceiver list advisory in the command layer. The platform
mapping still decides what is accepted; a profile missing from a port's
non-empty transceiver list is applied and reported as a warning after
the success line. When qsfp_service cannot be reached the command says
the profile was not checked. utility::applyPortProfileChanges keeps its
behaviour; the CLI no longer passes it the transceiver list.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants